<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>OAUTH2统一认证</title>

    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/signin.css" rel="stylesheet">
</head>

<body>
    <div class="container form-margin-top">
        <form class="form-signin" id="login_form" action="/authentication/require" method="post">
            <h2 class="form-signin-heading" align="center">统一认证系统</h2>
            <input type="text" name="username" class="form-control form-margin-top" placeholder="账号" required autofocus value="admin">
            <br/>
            <input type="password" name="password" class="form-control" placeholder="密码" required value="123456">
            <button class="btn btn-lg btn-primary btn-block" type="submit" id="login_btn">登录</button>
        </form>
    </div>
<!--    <footer>
        <p></p>
        <p></p>
    </footer>-->

    <script type="text/javascript" src="/js/jquery-1.12.4.js"></script>
    <script type="text/javascript">
//        $('#login_form').on('submit', function(e) {
//            e.preventDefault();
//            login_fn();
//        })
        function login_fn() {
            console.info("++++++", $("input[name='username']").val());
            $.ajax({
                url: '',
                type: 'POST',
                data: {
                    username: $("input[name='username']").val(),
                    password: $("input[name='password']").val()
                },
                success: function (res, status) {
                    window.location.href='/security/user'
                },
                error: function (res, status) {
                    dangerDialog(res.statusText);
                }
            });
        }

    </script>

</body>
</html>
